package org.ala.tiktools.sharddb.mybatis.router.shard_key_router;

import org.ala.tiktools.sharddb.mybatis.router.ShardInfo;

import java.util.Collections;
import java.util.Map;

/**
 * 根据分片建做路由
 *
 * @author ala
 * @date 2025-03-18 23:57
 */
public interface IShardKeyRouter<SK extends IShardKey> {
    /**
     *  空值
     */
    public static IShardKeyRouter NULL = new IShardKeyRouter() {
        public Map route(IShardKey iShardKey) {
            return Collections.emptyMap();
        }
    };


    /**
     *  执行分库分表
     */
    Map<ShardInfo, SK> route(SK sk);
}
